package jwj.swing.component;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class J13_BoxLayout extends JFrame {
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {			
			@Override
			public void run() {				
				new J13_BoxLayout();
			}
		});

	}
	
	public J13_BoxLayout() {
		setDefaultLookAndFeelDecorated(true);
		setTitle("BoxLayout = 수평/수직 배치");
		BoxLayout box = new BoxLayout(getContentPane(), BoxLayout.Y_AXIS);
		setLayout(box);	// 박스 레이아웃 지정
		
		setSize(250, 300);
		setLocationRelativeTo(null);
		
		
		for (int i = 1; i <= 10; ++i) {
			add(new JButton("버튼" + i));
		}
		
		setVisible(true);		
	}

}
